package top.yuhaitao.core.configuration;

import org.springframework.boot.SpringBootConfiguration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import top.yuhaitao.core.interceptor.CrossDomainInterceptor;

import javax.annotation.Resource;


@SpringBootConfiguration
public class CrossDomainConfiguration implements WebMvcConfigurer {

    @Resource
    private CrossDomainInterceptor crossDomainInterceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(crossDomainInterceptor).addPathPatterns("/**");
    }
}
